package net.mysoft.budgetsoft.system.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 
 * @author dagongPGP v1.0
 * @link <a href=http://www.dagongsoft.net>北京大公信软科技有限公司</a>
 * 
 * @version $Revision: 1.00 $Date: 2013-02-06 11:01:16
 */
//@Entity
//@Table(name = "tbDictionaryDetail")
public class TDictionaryDetail implements java.io.Serializable {
	private Integer id;
	private String detailID;
	private String detailName;
	private TDictionaryType type;
	private Integer orderNO;
	private String note;

	@Id
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "DetailID")
	public String getDetailID() {
		return this.detailID;
	}

	public void setDetailID(String detailID) {
		this.detailID = detailID;
	}

	@Column(name = "DetailName")
	public String getDetailName() {
		return detailName;
	}

	public void setDetailName(String detailName) {
		this.detailName = detailName;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TypeID")
	public TDictionaryType getType() {
		return type;
	}

	public void setType(TDictionaryType type) {
		this.type = type;
	}

	@Column(name = "OrderNO")
	public Integer getOrderNO() {
		return this.orderNO;
	}

	public void setOrderNO(Integer orderNO) {
		this.orderNO = orderNO;
	}

	@Column(name = "Note")
	public String getNote() {
		return this.note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	@Override
	public int hashCode() {
		if (this.getDetailID() == null)
			return super.hashCode();
		int prime = 0;
		prime += this.getDetailID().hashCode();
		return prime;
	}

	@Override
	public boolean equals(Object obj) {
		boolean isEquals = false;
		if (obj != null && this.getClass() == obj.getClass()) {
			TDictionaryDetail clazz = (TDictionaryDetail) obj;
			if (clazz.getDetailID().equals(this.getDetailID()))
				isEquals = true;
			return isEquals;
		}
		return isEquals;
	}
}